// $Id$
package at.etel.jdbc;


import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.Statement;

import oracle.jdbc.pool.OracleDataSource;
import org.apache.log4j.Logger;

public class Main
{
  private static Logger log 
      = Logger.getLogger(Thread.currentThread().getStackTrace()[0].getClassName());
  public static void main(String argv[]) {
    String connectString 
        = "dbc:oracle:thin:@192.168.193.30:1521:EUDB";
    String username = "euidb";
    String password = "test";
    try {
      OracleDataSource oracleDataSource = new OracleDataSource();
      oracleDataSource.setURL(connectString);
      Connection connection 
          = oracleDataSource.getConnection(username, password);
      Statement statement = connection.createStatement();
      String query = "SELECT COUNT(*) from ACCOUNT_T";
      ResultSet resultSet = statement.executeQuery(query);
      while (resultSet.next()) {
        log.info(resultSet.getString(1) + "\n");
      }
      DatabaseMetaData databaseMetaData = connection.getMetaData();
    } catch (Throwable t) {
      t.printStackTrace();
    };
  }
}
